package com.lemonadeempire;

import android.app.Activity;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.MapView.LayoutParams;

/**
public class LemonadeEmpire extends Activity {
    /** Called when the activity is first created. 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
*/
public class LemonadeEmpire extends MapActivity
{
	MapView mapView;
    MapController mc;
    GeoPoint p;
	
	/** Called when the activity is first created */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.map);
		
	    mapView = (MapView) findViewById(R.id.mapView);
        	    
        mc = mapView.getController();
        //(39.935537, -105.010296)
        String coordinates[] = {getLocation()};
        double lat = Double.parseDouble(coordinates[0]);
        double lng = Double.parseDouble(coordinates[1]);
 
        p = new GeoPoint(
            (int) (lat * 1), 
            (int) (lng * 1));
         
        mc.animateTo(p);
        mc.setZoom(17); 
        mapView.invalidate();
	}
	
	@Override
	protected boolean isRouteDisplayed(){
		return false;
	}

public String getLocation()
{
		LocationManager locMan = (LocationManager)getSystemService(LOCATION_SERVICE);
		Location loc = locMan.getLastKnownLocation(LocationManager.GPS_PROVIDER);
		return loc.toString();
}
}